feat: migrate build to zig, add cross-platform support#6
Conversation
Replace make-based build with zig, enabling Windows support and removing the need for a C compiler. Use mise's cmd module for command execution. Add shared platform and version modules. Include readline support via linenoize dependency. Signed-off-by: hazre <mail@haz.re>
There was a problem hiding this comment.
Code Review
This pull request migrates the Lua compilation process from using make to the Zig build system, enabling cross-platform builds (including Windows support) and introducing a readline shim using linenoise. The review identifies several critical issues that must be addressed: variable shadowing in post_install.lua that causes a runtime crash, incorrect usage of std.ArrayList instead of std.ArrayListUnmanaged in build.zig, a missing using_history implementation in the readline shim causing linker errors, and hardcoded library names on Windows. Additionally, feedback was provided to improve path quoting on Windows, handle EISDIR directory errors on Unix/macOS, and add zig to systemDependencies to avoid a hard dependency on mise exec and preserve vfox compatibility.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: hazre <mail@haz.re>
Signed-off-by: hazre <mail@haz.re>
Signed-off-by: hazre <mail@haz.re>
fixes #4
Swapped out
makeforzigto build Lua. Gets us Windows support and drops the need forcc/curl/readline, now you just needzig(andmakeis still around for luarocks bootstrap).build.zig+build.zig.zon: cross-platform zig build that compiles liblua.a, lua, luac, and headers, with readline emulation via linenoize (uses my own fork with zig 0.16.0 support, should be switched to upstream once merged)post_install.lua: rewritten to use mise'scmdmodule instead of shell commands.lib/platform.lua: cross platform file operations helperlib/version.lua: shared version parser used by env_keys and post_installenv_keys.lua: uses .dll on Windows instead of hardcoded .so, normalizes backslashes, always adds luarocks to PATHmetadata.lua: tidied into a singlePLUGIN = { ... }, removed cc, curl, readline.mise-tasks/test.mjs: Node.js test that installs lua and checks version, luarocks.hk.pkl: added zig fmt linter.